# -*- coding: UTF-8 -*-
#!/usr/bin/env python

import cv2

def showImg():
    image_path="Z:\project\face"
    img=cv2.imread(image_path)# np.ndarray BGR uint8
    cv2.imshow("test_imread",img)# 转为RGB显示

    cv2.waitKey()

def convert(face_x, face_y, face_w, face_h, zoom_ratio, imgw, imgh):
    print("input", face_x, face_y, face_w, face_h, zoom_ratio, imgw, imgh)
    left=imgw/2-imgw/2*zoom_ratio
    top= imgh/2-imgh/2*zoom_ratio
   # W=imgw/zoom_ratio
   # H=imgh/zoom_ratio
    o_face_x=zoom_ratio*(left-face_x)
    o_face_y=zoom_ratio*（top-face_y）
	o_face_w=zoom_ratio*face_w
	o_face_h =zoom_ratio*face_h
    print("output", o_face_x,o_face_y,o_face_w,o_face_h)
    return o_face_x,o_face_y,o_face_w,o_face_h
    

zoom = 1.5
convert(317,230,212,252,zoom,879,582)

